package com.six.work.servicesImpl;

import com.six.work.entity.Ad;
import com.six.work.entity.AdView;
import com.six.work.entity.Announcement;
import com.six.work.entity.AnnouncementView;
import com.six.work.mapper.AdMapper;
import com.six.work.services.AdServices;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class AdServicesImpl implements AdServices {
    @Autowired
    private AdMapper adMapper;

    @Override
    public List<AdView> findAllAd() {
        List<AdView> list = adMapper.findAllAd();
        return list;
    }

    @Override
    public Integer DelAdByID(Integer ad_id){
        return adMapper.DelAdByID(ad_id);
    }

    @Override
    public Integer insertAd(Ad ad) {
        return adMapper.insertAd(ad);
    }

    @Override   //修改
    public Ad SelectAdByID(Integer ad_id) {
        return adMapper.SelectAdByID(ad_id);
    }

    @Override     //修改
    public Integer updateAd(Ad ad) {
        return adMapper.updateAd(ad);
    }

    @Override
    public List<AdView> findAdByName(String adTitle) {
        return adMapper.findAdByName(adTitle);
    }

    @Override
    public List<AdView> findAdByadIDAndannName(String adTitle, Integer admin_id) {
        return adMapper.findAdByadIDAndannName(adTitle,admin_id);
    }

    @Override
    public List<Ad> findAd(){
        return adMapper.findAd();
    }

    @Override
    public List<Ad> findAd2(){
        return adMapper.findAd2();
    }
}
